//package com.zmn.plat.dubbo.impl.product.tariff;
//
//import com.alibaba.fastjson.JSON;
//import com.zmn.common.constant.GlobalConsts;
//import com.zmn.common.dto2.ResponseDTO;
//import com.zmn.common.utils.number.NumberUtil;
//import com.zmn.manager.common.database.annotation.ReadOnlyConnection;
//import com.zmn.plat.business.interfaces.channel.ChannelBService;
//import com.zmn.plat.business.interfaces.channel.ChannelServiceCategoryBService;
//import com.zmn.plat.business.interfaces.product.tariff.TariffProductBService;
//import com.zmn.plat.common.dto.brand.BaseBrandPageDRO;
//import com.zmn.plat.common.dto.product.tariff.TariffBackProductDRO;
//import com.zmn.plat.common.dto.product.tariff.TariffProductDIO;
//import com.zmn.plat.common.dto.product.tariff.TariffProductPageDRO;
//import com.zmn.plat.common.dto.product.tariff.brand.TariffBrandFactorDIO;
//import com.zmn.plat.common.dto.product.tariff.category.*;
//import com.zmn.plat.common.dto.product.tariff.item.*;
//import com.zmn.plat.common.dto.product.tariff.servcategory.TariffServCategoryDRO;
//import com.zmn.plat.common.dto.servcategory.ServCategoryChildrenDRO;
//import com.zmn.plat.common.exception.PlatException;
//import com.zmn.plat.dubbo.interfaces.product.tariff.TariffProductListRemoteService;
//import com.zmn.plat.dubbo.utils.DubboConsts;
//import com.zmn.plat.services.interfaces.category.BaseCategoryService;
//import com.zmn.plat.services.interfaces.channel.ChannelServiceCategoryService;
//import com.zmn.plat.services.interfaces.product.ServProductService;
//import com.zmn.plat.services.interfaces.servcategory.ServCategoryService;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.dubbo.config.annotation.Service;
//
//import javax.annotation.Resource;
//import java.util.List;
//
///**
// * @author tanbiao
// * @description:计价器相关接口实现类
// * @modifier
// * @since 2020/3/25 14:31
// **/
//@Service(version = DubboConsts.INTERFACE_VERSION, validation = "true")
//@Slf4j
//public class TariffProductListRemoteServiceImpl implements TariffProductListRemoteService {
//
//    @Resource
//    private TariffProductBService tariffProductBService;
//
//    @Resource
//    private ServProductService servProductService;
//
//    @Resource
//    private ChannelServiceCategoryService channelServiceCategoryService;
//
//    @Resource
//    private ChannelBService channelBService;
//
//    @Resource
//    BaseCategoryService baseCategoryService;
//
//    @Resource
//    ServCategoryService servCategoryService;
//
//    @Resource
//    ChannelServiceCategoryBService channelServiceCategoryBService;
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<TariffServCategoryDRO>> listServCategoryByChannelIdAndCityIdAndTariffCategoryId(TariffCategoryRelationDIO dio) {
//        log.info("listServCategoryByChannelIdAndCityIdAndTariffCategoryId 参数为：dio={}", JSON.toJSONString(dio));
//
//        try {
//            List<TariffServCategoryDRO> list = tariffProductBService.listServCategoryByChannelIdAndCityIdAndTariffCategoryId(dio);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listServCategoryByChannelIdAndCityIdAndTariffCategoryId error.dio={}", dio, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<TariffProductPageDRO> listPageByTariffProductDIO(TariffProductDIO tariffProductDIO) {
//        log.info("listPageByTariffProductDIO 参数为：tariffProductDIO={}", JSON.toJSONString(tariffProductDIO));
//
//        try {
//            TariffProductPageDRO dro = tariffProductBService.listPageByTariffProductDIO(tariffProductDIO);
//            return ResponseDTO.success(dro);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listPageByTariffProductDIO error...tariffProductDIO={}", tariffProductDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<TariffProductItemDRO>> listByTariffProductItemCategDIO(TariffProductItemCategDIO tariffProductFaultItemCategDIO) {
//        log.info("listByTariffProductItemCategDIO 参数为：tariffProductFaultItemCategDIO={}", JSON.toJSONString(tariffProductFaultItemCategDIO));
//
//        try {
//            List<TariffProductItemDRO> list = tariffProductBService.listByTariffProductItemCategDIO(tariffProductFaultItemCategDIO);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listByTariffProductItemCategDIO error...tariffProductFaultItemCategDIO={}", tariffProductFaultItemCategDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<TariffCategoryDRO>> listByTariffCategoryDIO(TariffCategoryDIO tariffCategoryDIO) {
//        log.info("listByTariffCategoryDIO 参数为：tariffCategoryDIO={}", JSON.toJSONString(tariffCategoryDIO));
//
//        try {
//            List<TariffCategoryDRO> list = tariffProductBService.listByTariffCategoryDIO(tariffCategoryDIO);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listByTariffCategoryDIO error...tariffCategoryDIO={}", tariffCategoryDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<TariffBackProductDRO>> listProductByProductCategDIO(TariffProductCategoryDIO productFaultDIO) {
//        log.info("listProductByProductCategDIO 参数为：productFaultDIO={}", JSON.toJSONString(productFaultDIO));
//
//        try {
//            List<TariffBackProductDRO> list = tariffProductBService.listProductByProductFaultCategDIO(productFaultDIO);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listProductByProductCategDIO error...productFaultDIO={}", productFaultDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<BaseBrandPageDRO> listPageBrandByBrandFactorDIO(TariffBrandFactorDIO tariffBrandFactorDIO) {
//        log.info("listPageBrandByBrandFactorDIO 参数为：faultTariffBrandRatioDIO={}", JSON.toJSONString(tariffBrandFactorDIO));
//
//        try {
//            BaseBrandPageDRO dro = tariffProductBService.listPageBrandByBrandFactorDIO(tariffBrandFactorDIO);
//            return ResponseDTO.success(dro);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listPageBrandByBrandFactorDIO error...faultTariffBrandRatioDIO={}", tariffBrandFactorDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<TariffCategoryPageDRO> listCategoryPageByCategoryDIO(TariffCategoryPageDIO tariffCategoryPageDIO) {
//        log.info("listCategoryPageByCategoryDIO 参数为：tariffCategoryPageDIO={}", JSON.toJSONString(tariffCategoryPageDIO));
//
//        try {
//            TariffCategoryPageDRO dro = tariffProductBService.listCategoryPageByCategoryDIO(tariffCategoryPageDIO);
//            return ResponseDTO.success(dro);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listCategoryPageByCategoryDIO error...tariffCategoryPageDIO={}", tariffCategoryPageDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<TariffProductItemPriceDRO>> listItemPriceByProductIdAndItemIds(TariffProductItemPriceDIO query) {
//        log.info("listItemPriceByProductIdAndItemIds 参数为：query={}", JSON.toJSONString(query));
//
//        try {
//            List<TariffProductItemPriceDRO> list = tariffProductBService.listItemPriceByProductIdAndItemIds(query);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listItemPriceByProductIdAndItemIds error...query={}", query, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<TariffProductItemPriceUnknownDRO>> listProductPriceByTariffProductId(TariffProductItemUnknowCategoryDIO categoryDIO) {
//        log.info("listItemPriceByProductIdAndItemIds 参数为：categoryDIO={}", JSON.toJSONString(categoryDIO));
//
//        try {
//            List<TariffProductItemPriceUnknownDRO> list = tariffProductBService.listProductPriceByTariffProductId(categoryDIO);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listProductPriceByTariffProductId error...categoryDIO={}", categoryDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<TariffProductItemPriceUnknownDRO>> listProductPriceByCategId(TariffProductItemUnknowProductDIO categoryDIO) {
//        log.info("listItemPriceByProductIdAndItemIds 参数为：categoryDIO={}", JSON.toJSONString(categoryDIO));
//
//        try {
//            List<TariffProductItemPriceUnknownDRO> list = tariffProductBService.listProductPriceByCategId(categoryDIO);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listProductPriceByCategId error..., msg:{}, param:{}", e.getMessage(), categoryDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<TariffProductItemPriceDRO>> listByTariffBackProductItemCategDIO(TariffBackProductItemCategDIO productFaultItemDIO) {
//        log.info("listByTariffBackProductItemCategDIO 参数为：productFaultItemDIO={}", JSON.toJSONString(productFaultItemDIO));
//
//        try {
//            List<TariffProductItemPriceDRO> list = tariffProductBService.listByTariffBackProductItemCategDIO(productFaultItemDIO);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listByTariffBackProductItemCategDIO error...productFaultItemDIO={}", productFaultItemDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<TariffProductItemPriceDRO>> listByProductItemPriceSplitItemDIO(TariffProductItemPriceSplitItemDIO faultItemPriceDIO) {
//        log.info("listByProductItemPriceSplitItemDIO 参数为：faultItemPriceDIO={}", JSON.toJSONString(faultItemPriceDIO));
//
//        try {
//            List<TariffProductItemPriceDRO> list = tariffProductBService.listByProductItemPriceSplitItemDIO(faultItemPriceDIO);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listByProductItemPriceSplitItemDIO error...faultItemPriceDIO={}", faultItemPriceDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<TariffProductItemPriceDRO>> listByProductItemDefaultDIO(TariffProductItemDefaultDIO faultItemPriceDIO) {
//        log.info("listByProductItemDefaultDIO 参数为：faultItemPriceDIO={}", JSON.toJSONString(faultItemPriceDIO));
//
//        try {
//            List<TariffProductItemPriceDRO> list = tariffProductBService.listByProductItemDefaultDIO(faultItemPriceDIO);
//            return ResponseDTO.success(list);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listByProductItemDefaultDIO error...faultItemPriceDIO={}", faultItemPriceDIO, e);
//            return ResponseDTO.fail(GlobalConsts.FAILD_MSG);
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ServCategoryChildrenDRO>> listServAndCategByChannelIdAndCity(Integer channelId, Integer cityId) {
//
//        if (NumberUtil.isNullOrZero(channelId) || NumberUtil.isNullOrZero(cityId)) {
//            return ResponseDTO.fail("入参不能为null");
//        }
//        try {
//            List<ServCategoryChildrenDRO> servCategoryChildrenDROS = tariffProductBService.listServAndCategByChannelIdAndCity(channelId, cityId);
//            return ResponseDTO.success(servCategoryChildrenDROS);
//        } catch (Exception e) {
//            log.error("TariffProductListRemoteServiceImpl.listServAndCategByChannelId查询失败,原因:{}", e.getMessage(), e);
//            return ResponseDTO.fail("查询失败，程序异常");
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<TariffCategoryPageDRO> listTwoCategByChannelIdAndCity(Integer channelId, Integer cityId) {
//
//        if (NumberUtil.isNullOrZero(channelId) || NumberUtil.isNullOrZero(cityId)) {
//            return ResponseDTO.fail("入参不能为null");
//        }
//        try {
//            TariffCategoryPageDRO tariffCategoryPageDRO = tariffProductBService.listTwoCategByChannelIdAndCity(channelId, cityId);
//            return ResponseDTO.success(tariffCategoryPageDRO);
//        } catch (Exception e) {
//            log.error("TariffProductListRemoteServiceImpl.listTwoCategByChannelId查询失败,原因:{}", e.getMessage(), e);
//            return ResponseDTO.fail("查询失败，程序异常");
//        }
//    }
//}
